﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WFASmartketing.REPORTES
{
    public partial class ReporteVentasRealizadasWF : Form
    {
        public ReporteVentasRealizadasWF()
        {
            InitializeComponent();
            comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 0;
        }

        private void ReporteVentasRealizadasWF_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'clienteDSReporte.cliente' table. You can move, or remove it, as needed.
            this.clienteTableAdapter.Fill(this.clienteDSReporte.cliente);
            // TODO: This line of code loads data into the 'ReporteVentasRealizadasDS.ReporteListaVenta' table. You can move, or remove it, as needed.
            RecaqrgarReporte();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            RecaqrgarReporte();
        }
             private void RecaqrgarReporte()
        {
            string cliente = cbxproveedor.SelectedValue.ToString();
            string estadocompra = "";
            if (comboBox1.SelectedItem.ToString().Equals("TODOS"))
            {
                estadocompra = "%%";
            }
            else { estadocompra = comboBox1.SelectedItem.ToString(); }
            string tipocompra = "";
            if (comboBox2.SelectedItem.ToString().Equals("TODOS"))
            {
                tipocompra = "%%";
            }
            else { tipocompra = comboBox2.SelectedItem.ToString(); }
            this.ReporteListaVentaTableAdapter.Fill(this.ReporteVentasRealizadasDS.ReporteListaVenta, estadocompra, tipocompra, cliente);
            this.reportViewer1.RefreshReport();
        
        }
    }
}
